﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AnyGrid.Demo.Models
{
    public class FakeEntityService
    {
        private IEnumerable<ListRow> _data;

        public IEnumerable<ListRow> SelectAll()
        {
            return _data;
        }

        public FakeEntityService()
        {
            this._data = GenerateRandomData();
        }

        private IEnumerable<ListRow> GenerateRandomData()
        {
            return from i in Enumerable.Range(1, 100)
                   select new ListRow
                   {
                       Id = i,
                       Code = i,
                       Description = i.ToString()
                   };
        }
    }
}